<template>
  <div class="list-wrapper">
    <table class="list-table" border="0" cellspacing="0" cellpadding="0">
      <thead>
      <tr>
        <th width="160">身份证号码/SIB</th>
        <th>姓名</th>
        <th>邮箱</th>
        <th>电话</th>
        <th>职位</th>
        <th>同职务海龄</th>
        <th>船型</th>
        <th>船东</th>
        <th>代理公司</th>
      </tr>
      </thead>
      <tbody>
      <tr v-for="item in list" :key="item.id" @click="detail(item.id)">
        <td>{{item.idcard||item.sib}}</td>
        <td>{{item.name || item.ename}}</td>
        <td>{{item.email}}</td>
        <td>{{item.tel}}</td>
        <td>{{item.zhiwu}}</td>
        <td>{{item.agework}}</td>
        <td>{{item.crewtype}}</td>
        <td>{{item.chuandong}}</td>
        <td>{{item.daili}}</td>
      </tr>
      </tbody>
    </table>
    <div class="namtc-pagination">
      <el-pagination @current-change="handleCurrentChange" :current-page="page" :page-size="10"
                     layout="total, prev, pager, next, jumper" :total="total">
      </el-pagination>
    </div>
  </div>
</template>
<script>
  const search = {
    idcard: '',
    sib: '',
    name: '',
    ename: '',
    sex: [],
    education: '',
    birth1: '',
    birth2: '',
    zhiwu: '',
    agework: '',
    chuandong: '',
    daili: '',
    self: [],
    crewtype: '',
    country: '',
    province: '',
    duedate: '',
    times: '',
    tel: '',
    email: '',
    talk: [],
    intent: '',
  }
  export default {
    data() {
      return {
        page: 1,
        total: 0,
        list: [],
        search: {},
        student: '',
      }
    },
    
    methods: {
      fetchData(){
        let data = this.search || _g.cloneJson(search)
        data.page = this.page
        this.apiPost('Trainee/traineeLists', data).then(res=>{
          this.list = res.list
          this.total = parseInt(res.total)
        })
      },

      handleCurrentChange(val){
        this.page = val
        this.fetchData()
      },

      detail(id){
        router.push('/trainee/detail/'+id)
      }
    },
    created(){
      this.search = Lockr.get('traineeSearch')
      this.fetchData()
    },

  }
</script>
<style scoped>

</style>
